home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / BUS / DynRisk 68k 4.01 demo.sit / DynRisk-Help.rsrc / TEXT_6525.txt < prev    next >
Text File  |  1996-08-30  |  1KB  |  33 lines

  1. Trim1
  2.  
  3. A simple trim function. This function replaces input values greater than or equal to the 窶彙窶 parameter by the 窶彗窶 parameter. Input values less than the 窶彙窶 parameter are multiplied by a constant equal to the ratio between the 窶彗窶 and 窶彙窶 parameters. In the special case when 窶彙窶 is zero, the function replaces all input values by the 窶彗窶 parameter.
  4.  
  5. If the 窶彗窶 and the 窶彙窶 parameters both have the same sign (both positive or both negative), the 窶彗窶 parameter is an upper bound on the output values. In such cases the ratio between 窶彗窶 and 窶彙窶 is positive, and the Trim1 function takes the following form:
  6.  
  7.     Output = Min(Input (a/b), a)
  8.  
  9. On the other hand if the 窶彗窶 and the 窶彙窶 parameters have opposite signs, the 窶彗窶 parameter is a lower bound on the output values. In such cases the ratio between 窶彗窶 and 窶彙窶 is negative, and the Trim1 function takes the following form:
  10.  
  11.     Output = Max(Input (a/b), a)
  12.  
  13. In most cases you will probably use the Trim1 function with positive parameter values. In the special case when 窶彗窶 and 窶œ b窶 are equal, the Trim1 function takes the following simplified form:
  14.  
  15.     Output = Min(Input, a)
  16.  
  17. Thus, in such cases the Trim1 function may be replaced by the Min function.
  18.  
  19. Default parameter values:
  20.     a = 1, b = 1
  21.  
  22. Example 1:
  23.     a = 4, b = 7
  24.  
  25.     Input = 5  =>  Output = 2.857
  26.     Input = 9  =>  Output = 4
  27.  
  28. Example 2:
  29.     a = -4, b = 7
  30.  
  31.     Input = 5  =>  Output = -2.857
  32.     Input = 9  =>  Output = -4
  33.